package org.example.domain.user_participate.service.impl;

import org.example.domain.user_participate.model.entity.LotteryRecordEntity;
import org.example.domain.user_participate.repository.IUserParticipateRepo;
import org.example.domain.user_participate.service.IUserParticipateService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lxc18
 * @date 2025/3/24 11:01
 * @description IUserParticipateServiceImpl
 */
@Service
public class IUserParticipateServiceImpl implements IUserParticipateService {
    @Resource
    private IUserParticipateRepo userParticipateRepo;
    @Override
    public int queryUserParticipateQuota(Long userId, Long activityId) {
        return userParticipateRepo.queryUserParticipateQuota(userId, activityId);
    }

    @Override
    public int queryUserUsedQuota(Long userId, Long activityId) {
        return userParticipateRepo.queryUserUsedQuota(userId, activityId);
    }

    @Override
    public boolean addUserParticipateQuota(Long userId, Long activityId, int quotaNum) {
        return userParticipateRepo.addUserParticipateQuota(userId, activityId, quotaNum);
    }

    @Override
    public List<LotteryRecordEntity> queryUserLotteryRecord(Long id) {
        return userParticipateRepo.queryUserLotteryRecord(id);
    }
}
